package models;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author eagle_eye
 */
@Entity
@Table(name = "ASIGNATURA", catalog = "sischool2", schema = "")
@NamedQueries({
    @NamedQuery(name = "Asignatura.findAll", query = "SELECT a FROM Asignatura a"),
    @NamedQuery(name = "Asignatura.findByIdAsignatura", query = "SELECT a FROM Asignatura a WHERE a.idAsignatura = :idAsignatura"),
    @NamedQuery(name = "Asignatura.findByNombreasignatura", query = "SELECT a FROM Asignatura a WHERE a.nombreasignatura = :nombreasignatura"),
    @NamedQuery(name = "Asignatura.findByIntensidadhoraria", query = "SELECT a FROM Asignatura a WHERE a.intensidadhoraria = :intensidadhoraria"),
    @NamedQuery(name = "Asignatura.findByHora", query = "SELECT a FROM Asignatura a WHERE a.hora = :hora")})
public class Asignatura implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idAsignatura", nullable = false)
    private Integer idAsignatura;
    @Column(name = "nombreasignatura", length = 45)
    private String nombreasignatura;
    @Column(name = "intensidadhoraria", length = 32)
    private String intensidadhoraria;
    @Column(name = "hora", length = 45)
    private String hora;
    @JoinColumn(name = "areaId", referencedColumnName = "idArea", nullable = false)
    @ManyToOne(optional = false)
    private Area areaId;
    @JoinColumn(name = "gradoId", referencedColumnName = "idGrado", nullable = false)
    @ManyToOne(optional = false)
    private Grado gradoId;
    @JoinColumn(name = "laboratorioId", referencedColumnName = "idLaboratorio")
    @ManyToOne
    private Laboratorio laboratorioId;
    @JoinColumn(name = "diaId", referencedColumnName = "idDia", nullable = false)
    @ManyToOne(optional = false)
    private Dia diaId;
    @OneToMany(mappedBy = "asignaturaId")
    private List<Profesor> profesorList;
    @OneToMany(mappedBy = "asignaturaId")
    private List<Calificacion> calificacionList;

    public Asignatura() {
    }

    public Asignatura(Integer idAsignatura) {
        this.idAsignatura = idAsignatura;
    }

    public Integer getIdAsignatura() {
        return idAsignatura;
    }

    public void setIdAsignatura(Integer idAsignatura) {
        this.idAsignatura = idAsignatura;
    }

    public String getNombreasignatura() {
        return nombreasignatura;
    }

    public void setNombreasignatura(String nombreasignatura) {
        this.nombreasignatura = nombreasignatura;
    }

    public String getIntensidadhoraria() {
        return intensidadhoraria;
    }

    public void setIntensidadhoraria(String intensidadhoraria) {
        this.intensidadhoraria = intensidadhoraria;
    }

    public String getHora() {
        return hora;
    }

    public void setHora(String hora) {
        this.hora = hora;
    }

    public Area getAreaId() {
        return areaId;
    }

    public void setAreaId(Area areaId) {
        this.areaId = areaId;
    }

    public Grado getGradoId() {
        return gradoId;
    }

    public void setGradoId(Grado gradoId) {
        this.gradoId = gradoId;
    }

    public Laboratorio getLaboratorioId() {
        return laboratorioId;
    }

    public void setLaboratorioId(Laboratorio laboratorioId) {
        this.laboratorioId = laboratorioId;
    }

    public Dia getDiaId() {
        return diaId;
    }

    public void setDiaId(Dia diaId) {
        this.diaId = diaId;
    }

    public List<Profesor> getProfesorList() {
        return profesorList;
    }

    public void setProfesorList(List<Profesor> profesorList) {
        this.profesorList = profesorList;
    }

    public List<Calificacion> getCalificacionList() {
        return calificacionList;
    }

    public void setCalificacionList(List<Calificacion> calificacionList) {
        this.calificacionList = calificacionList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAsignatura != null ? idAsignatura.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Asignatura)) {
            return false;
        }
        Asignatura other = (Asignatura) object;
        if ((this.idAsignatura == null && other.idAsignatura != null) || (this.idAsignatura != null && !this.idAsignatura.equals(other.idAsignatura))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.Asignatura[idAsignatura=" + idAsignatura + "]";
    }

}
